Hi there,
How do i reproduce the escalate button in the WebUI through the API? What are the different API calls needed given an incident id.
Regards
Hi there,
How do i reproduce the escalate button in the WebUI through the API? What are the different API calls needed given an incident id.
Regards
Hello,
Thanks for reaching out on our community page! The API call best suited for this would be āupdate incidentā - there are details on the document below. Specifically escalation_level
and assign
being the fields used to update the incident -
https://developer.pagerduty.com/api-reference/8a0e1aa2ec666-update-an-incident
Hope this helps.
John
John OāDonnell
Team Lead, EMEA Support@pagerduty.com
How do i know how to bump escalation_level
to which integer ?
Hey Quentin,
The EP levels would correspond to the same number level they are in the UI. To get this information you will need to use the Get an incident to retrieve the Escalation Policy id
from the escalation_policy
object within the incident
object (ensuring you note the assignee
(s) in the assignments
array to compare to the targets
array in the next part). Then you will need to use Get an escalation policy using that id
value to get the size of the escalation_rules
array.
This requires some minor coding/scripting to find the size of the array as it isnāt a value that we return from an API call. The size of the array equals the number of escalation rules that are available. You can then drill down to the targets
array to find the actual schedules or users that the Escalation Policy contains.
Comparing the targets
to the assignees
will allow you to understand which level of the escalation policy they are currently using, and then you can update the incident to escalate to whatever level by using Update an incident with a body like the below for example:
{
āincidentā: {
āescalation_levelā: 2,
ātypeā: āincidentā
}
}
Hope this helps.
John
John OāDonnell
Team Lead, EMEA Support@pagerduty.com
Thanks for this detailed answer.
Does Updating Incident assignments
with new assignee
without updating escalation_level
is considered as an escalation for PD ?
Hello,
Updating the assignee field would be assigning it directly to a person, meaning there would be no automatic change if the user didnāt respond. But this would still work.
John
John OāDonnell
Team Lead, EMEA Support@pagerduty.com